package com.fwtai.web;

import com.fwtai.bean.PageFormData;
import com.fwtai.datasource.DaoHandle;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;

/**
 * 电话咨询律师统计访问数据库
 * @作者 李宇鹏
 * @版本 v1.0
 * @创建时间 2023-02-28 09:28:02
 * @QQ号码 444141300
 * @Email service@yinlz.com
 * @官网 <url>http://www.fwtai.com</url>
*/
@Repository
public class ConsultStatisticsDao{

  private final DaoHandle dao;

  public ConsultStatisticsDao(final DaoHandle dao){
    this.dao = dao;
  }

  public HashMap<String,Object> queryById(final long kid){//当是long类型时就不能传null空值,否则报空指针
    return dao.queryForHashMap("consult_statistics.queryById",kid);
  }

  public List<HashMap<String,Object>> getListData(final PageFormData formData){
    return dao.queryForListHashMap("consult_statistics.listData",formData);
  }

  public Integer getListTotal(final PageFormData formData){
    return dao.queryForInteger("consult_statistics.listTotal",formData);
  }

  public List<HashMap<String,Object>> getLawyerRecord(final PageFormData formData){
    return dao.queryForListHashMap("consult_statistics.getLawyerRecord",formData);
  }

  public Integer getLawyerRecordTotal(final PageFormData formData){
    return dao.queryForInteger("consult_statistics.lawyerRecordTotal",formData);
  }

  public List<HashMap<String,Object>> getUserRecord(final PageFormData formData){
    return dao.queryForListHashMap("consult_statistics.getUserRecord",formData);
  }

  public Integer getUserRecordTotal(final PageFormData formData){
    return dao.queryForInteger("consult_statistics.userRecordTotal",formData);
  }
}